<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<title>封条管理及验证系统--系统消息新增/修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="<%=request.getContextPath()%>/css/cssCn.css" type="text/css" rel="stylesheet">
<%@ include file="/comm.jsp"%>
<script language="JavaScript" src="<%=request.getContextPath()%>/js/fck_email/fckeditor.js"></script>
<script type="text/javascript">
	window.onload = function()
	{
		var sBasePath = '<%=request.getContextPath()%>/js/fck_email/' ;
		var oFCKeditor = new FCKeditor( 'content' ) ;
		oFCKeditor.BasePath	= sBasePath ;
		oFCKeditor.Height = 300 ;
		oFCKeditor.ToolbarSet = 'freemail';
		oFCKeditor.ReplaceTextarea() ;
	}
	
	function typeChange(pidVal){
		var subtype=$d("subtype");
		subtype.options.length = 0;
		if(pidVal=="-1")
			return;
		
		var params = {
					pid:pidVal
					};
		$.ajax({type: "POST",
		       url: "ajax_loadSubtype.do",
		       data: params,
		       async: true,
		       success: function(result){
				 if(result.retcode=='0000'){
				    var itemList = result.itemList;
				    subtype.options[0] = new Option('请选择','-1');
					for(var i=0;i<itemList.length;i++){
						var ca=itemList[i];
						subtype.options[i+1] = new Option(ca.value,ca.key);
					}	
				 }
			  }
			},"json");
	}
</script>

	<style type="text/css">
	<!--
	fieldset {
	    padding:10px;
	    margin:10px;
	    width:270px;
	    color:#333; 
	} 
	legend {
	    color:#06c;
	    font-weight:800; 
	} 
		-->
	</style>
<body leftmargin="0" topmargin="0" marginheight="0" >
  <s:form name ="formpage" action="notice_save" namespace="/">
  	<s:token>
	</s:token>
	<div>
	<s:hidden id="hdfId" name="notice.id" value="%{#request.notice.id}" />
  	<%@ include file="/messages.jsp"%>
			<fieldset>
				<legend>
					系统消息发布
				</legend>
				<table  width="750" border="1" align="left">
					<tr>
						<td align="right" width="100">
							标题：
						</td>
						<td colspan="3">
							<input name="notice.title" type="text" value="${notice.title }"
							 maxlength="40" size="50" class="required"  title="*必填"
							/>
						</td>
					</tr>
					<tr>
						<td align="right">
							分类：</td>
						<td colspan="3">
							<s:select list="#request.typeList"
							 	headerKey="-1" headerValue="请选择" 
								name="notice.type" value="#request.notice.type"
								onchange="typeChange(this.value);"
								id="type" cssStyle="width:120px">
							</s:select>
						
							<s:select list="#request.subtypeList"
								name="notice.subtype" value="#request.notice.subtype"
								id="subtype" cssStyle="width:150px">
							</s:select>
							
						</td>
					</tr>
					
					<tr>
						<td align="right">
							有效期：
						</td>
						<td colspan="3">
							<input id="dStartdate" name="notice.startDate" 
							 	value='<s:date name="#request.notice.startDate" format="yyyy-MM-dd" />'
							 	size="13" class="Wdate" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'dEnddate\')}'})"/> 
							至
							<input id="dEnddate" name="notice.endDate" 
							 	value='<s:date name="#request.notice.endDate" format="yyyy-MM-dd" />'
							 	size="13" class="Wdate" type="text" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'dStartdate\')}'})"/>
						</td>
					</tr>
					<tr>
						
						<td align="right">
							语言：
						</td>
						<td>
							<s:select list="#{'zh_CN':'中文','en':'英文'}"	 
							 name="notice.lang"
					  		 value="#request.notice.lang" 
					  		 id="lang"
					  		 cssStyle="width:80px" >
							</s:select>
						</td>
						<td align="right" width="100">
							排序序号：
						</td>
						<td>
							<input name="notice.orderNum" type="text" value="${notice.orderNum }"
							 maxlength="3" size="10"/>
						</td>
					</tr>
					
					
					<tr>
						<td align="right">
							内容：
						</td>
						<td colspan="3">
							<textarea id="content" name="notice.content" rows="6" cols="80">${notice.content }</textarea>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="center">
							<input type="submit" class="button" id="ok" name="ok"
								value=" 保 存 " />
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" class="button" id="resets" value=" 返 回 " onclick="javascript:history.go(-1)"/>
						</td>
					</tr>
				</table>
			</fieldset>
			</div>
		</s:form>
  </body>
</html>